Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[swss][arp_update] Send ipv6 pings over vlan sub interfaces #8363

Merged
merged 1 commit into from
Aug 7, 2021

Conversation

lolyu
Copy link
Contributor

@lolyu lolyu commented Aug 6, 2021

Why I did it

  • arp_update fails to ping those neighbors over vlan sub interfaces.

How I did it

  • modify arp_update_vars.j2 to get vlan sub interfaces with ipv6 addresses assigned.
  • modify arp_update to send ipv6 pings over those retrieved vlan sub interfaces.

How to verify it

  • run arp_update on t0-backend topology with set -x
root@str2-7050qx-32s-acs-02:/# ./arp_update
+ ARP_UPDATE_VARS_FILE=/usr/share/sonic/templates/arp_update_vars.j2
+ /bin/true
++ sonic-cfggen -d -t /usr/share/sonic/templates/arp_update_vars.j2
+ ARP_UPDATE_VARS='{
    "interface": "",
    "pc_interface" : "",
    "vlan_sub_interface": "Ethernet100.10 Ethernet104.10 Ethernet108.10 Ethernet112.10 Ethernet116.10 Ethernet120.10 Ethernet124.10 Ethernet80.10 Ethernet84.10 Ethernet88.10 Ethernet92.10 Ethernet96.10 ",

    "vlan" : "Vlan1000"
}'
++ echo '{' '"interface":' '"",' '"pc_interface"' : '"",' '"vlan_sub_interface":' '"Ethernet100.10' Ethernet104.10 Ethernet108.10 Ethernet112.10 Ethernet116.10 Ethernet120.10 Ethernet124.10 Ethernet80.10 Ethernet84.10 Ethernet88.10 Ethernet92.10 Ethernet96.10 '",' '"vlan"' : '"Vlan1000"' '}'
++ jq -r .interface
+ INTERFACE=
++ echo '{' '"interface":' '"",' '"pc_interface"' : '"",' '"vlan_sub_interface":' '"Ethernet100.10' Ethernet104.10 Ethernet108.10 Ethernet112.10 Ethernet116.10 Ethernet120.10 Ethernet124.10 Ethernet80.10 Ethernet84.10 Ethernet88.10 Ethernet92.10 Ethernet96.10 '",' '"vlan"' : '"Vlan1000"' '}'
++ jq -r .pc_interface
+ PC_INTERFACE=
++ echo '{' '"interface":' '"",' '"pc_interface"' : '"",' '"vlan_sub_interface":' '"Ethernet100.10' Ethernet104.10 Ethernet108.10 Ethernet112.10 Ethernet116.10 Ethernet120.10 Ethernet124.10 Ethernet80.10 Ethernet84.10 Ethernet88.10 Ethernet92.10 Ethernet96.10 '",' '"vlan"' : '"Vlan1000"' '}'
++ jq -r .vlan_sub_interface
+ VLAN_SUB_INTERFACE='Ethernet100.10 Ethernet104.10 Ethernet108.10 Ethernet112.10 Ethernet116.10 Ethernet120.10 Ethernet124.10 Ethernet80.10 Ethernet84.10 Ethernet88.10 Ethernet92.10 Ethernet96.10 '
+ ALL_INTERFACE='  Ethernet100.10 Ethernet104.10 Ethernet108.10 Ethernet112.10 Ethernet116.10 Ethernet120.10 Ethernet124.10 Ethernet80.10 Ethernet84.10 Ethernet88.10 Ethernet92.10 Ethernet96.10 '
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet100.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet100.10
++ grep 'state UP'
+ intf_up='881: Ethernet100.10@Ethernet100: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 881: Ethernet100.10@Ethernet100: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet100.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet100.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet100.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet104.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet104.10
++ grep 'state UP'
+ intf_up='883: Ethernet104.10@Ethernet104: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 883: Ethernet104.10@Ethernet104: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet104.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet104.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet104.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet108.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet108.10
++ grep 'state UP'
+ intf_up='884: Ethernet108.10@Ethernet108: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 884: Ethernet108.10@Ethernet108: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet108.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet108.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet108.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet112.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet112.10
++ grep 'state UP'
+ intf_up='894: Ethernet112.10@Ethernet112: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 894: Ethernet112.10@Ethernet112: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet112.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet112.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet112.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet116.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet116.10
++ grep 'state UP'
+ intf_up='895: Ethernet116.10@Ethernet116: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 895: Ethernet116.10@Ethernet116: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet116.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet116.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet116.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet120.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet120.10
++ grep 'state UP'
+ intf_up='851: Ethernet120.10@Ethernet120: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 851: Ethernet120.10@Ethernet120: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet120.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet120.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet120.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet124.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet124.10
++ grep 'state UP'
+ intf_up='853: Ethernet124.10@Ethernet124: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 853: Ethernet124.10@Ethernet124: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet124.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet124.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet124.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet80.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet80.10
++ grep 'state UP'
+ intf_up='887: Ethernet80.10@Ethernet80: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 887: Ethernet80.10@Ethernet80: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet80.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet80.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet80.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet84.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet84.10
++ grep 'state UP'
+ intf_up='889: Ethernet84.10@Ethernet84: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 889: Ethernet84.10@Ethernet84: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet84.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet84.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet84.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet88.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet88.10
++ grep 'state UP'
+ intf_up='890: Ethernet88.10@Ethernet88: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 890: Ethernet88.10@Ethernet88: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet88.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet88.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet88.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet92.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet92.10
++ grep 'state UP'
+ intf_up='892: Ethernet92.10@Ethernet92: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 892: Ethernet92.10@Ethernet92: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet92.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet92.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet92.10.
+ for intf in $ALL_INTERFACE
+ ping6cmd='ping6 -I Ethernet96.10 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
++ ip link show Ethernet96.10
++ grep 'state UP'
+ intf_up='893: Ethernet96.10@Ethernet96: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000'
+ [[ -n 893: Ethernet96.10@Ethernet96: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc noqueue state UP mode DEFAULT group default qlen 1000 ]]
+ eval ping6 -I Ethernet96.10 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Ethernet96.10 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Ethernet96.10.
++ echo '{' '"interface":' '"",' '"pc_interface"' : '"",' '"vlan_sub_interface":' '"Ethernet100.10' Ethernet104.10 Ethernet108.10 Ethernet112.10 Ethernet116.10 Ethernet120.10 Ethernet124.10 Ethernet80.10 Ethernet84.10 Ethernet88.10 Ethernet92.10 Ethernet96.10 '",' '"vlan"' : '"Vlan1000"' '}'
++ jq -r .vlan
+ VLAN=Vlan1000
+ for vlan in $VLAN
+ arpingcmd='sed -e '\''s/ / -i /'\'' -e '\''s/^/arping -q -w 0 -c 1 /'\'' -e '\''s/$/;/'\'''
+ ipcmd='ip -4 neigh show | grep Vlan1000 | cut -d '\'' '\'' -f 1,3 | sed -e '\''s/ / -i /'\'' -e '\''s/^/arping -q -w 0 -c 1 /'\'' -e '\''s/$/;/'\'''
++ eval ip -4 neigh show '|' grep Vlan1000 '|' cut -d \' \' -f 1,3 '|' sed -e ''\''s/' / -i '/'\''' -e ''\''s/^/arping' -q -w 0 -c 1 '/'\''' -e ''\''s/$/;/'\'''
+++ ip -4 neigh show
+++ grep Vlan1000
+++ cut -d ' ' -f 1,3
+++ sed -e 's/ / -i /' -e 's/^/arping -q -w 0 -c 1 /' -e 's/$/;/'
+ eval
+ ping6cmd='ping6 -I Vlan1000 -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null'
+ eval ping6 -I Vlan1000 -n -q -i 0 -c 1 -W 0 ff02::1 '>/dev/null'
++ ping6 -I Vlan1000 -n -q -i 0 -c 1 -W 0 ff02::1
ping6: Warning: source address might be selected on device other than Vlan1000.
+ ndisc6cmd='sed -e '\''s/^/ndisc6 -q -w 0 -1 /'\'' -e '\''s/$/;/'\'''
+ ip6cmd='ip -6 neigh show | grep -v fe80 | grep Vlan1000 | cut -d '\'' '\'' -f 1,3 | sed -e '\''s/^/ndisc6 -q -w 0 -1 /'\'' -e '\''s/$/;/'\'''
++ eval ip -6 neigh show '|' grep -v fe80 '|' grep Vlan1000 '|' cut -d \' \' -f 1,3 '|' sed -e ''\''s/^/ndisc6' -q -w 0 -1 '/'\''' -e ''\''s/$/;/'\'''
+++ ip -6 neigh show
+++ grep -v fe80
+++ grep Vlan1000
+++ cut -d ' ' -f 1,3
+++ sed -e 's/^/ndisc6 -q -w 0 -1 /' -e 's/$/;/'
+ eval
+ sleep 300
^C

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu lolyu requested a review from lguohan as a code owner August 6, 2021 10:44
@lolyu lolyu requested review from neethajohn, yxieca and prsunny August 6, 2021 10:46
@lolyu
Copy link
Contributor Author

lolyu commented Aug 6, 2021

/AZP run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lguohan lguohan merged commit 6283716 into sonic-net:master Aug 7, 2021
@lolyu lolyu deleted the arp_update_vlan_sub_intf branch August 7, 2021 12:38
qiluo-msft pushed a commit that referenced this pull request Aug 7, 2021
#### Why I did it
* `arp_update` fails to ping those neighbors over vlan sub interfaces.

#### How I did it
* modify `arp_update_vars.j2` to get vlan sub interfaces with ipv6 addresses assigned.
* modify `arp_update` to send ipv6 pings over those retrieved vlan sub interfaces.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…t#8363)

#### Why I did it
* `arp_update` fails to ping those neighbors over vlan sub interfaces.

#### How I did it
* modify `arp_update_vars.j2` to get vlan sub interfaces with ipv6 addresses assigned.
* modify `arp_update` to send ipv6 pings over those retrieved vlan sub interfaces.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
judyjoseph pushed a commit that referenced this pull request Aug 25, 2021
#### Why I did it
* `arp_update` fails to ping those neighbors over vlan sub interfaces.

#### How I did it
* modify `arp_update_vars.j2` to get vlan sub interfaces with ipv6 addresses assigned.
* modify `arp_update` to send ipv6 pings over those retrieved vlan sub interfaces.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants